﻿@using WebMarkupMin.Example.Mvc.ViewModels
@using WebMarkupMin.Example.Mvc.Infrastructure.Helpers;
@using WebMarkupMin.Example.Mvc.Resources;

@model XhtmlMinificationViewModel

@{
	ViewBag.Title = "XHTML Minifier";
}

<h2>@ViewBag.Title</h2>

@using (Html.BeginForm("index", "xhtml-minifier", FormMethod.Post, new { data_form_type = "minification-form" }))
{
	<div class="minification-form">
		<div class="minification-input-output">
			@Html.Partial("_MinificationInputOutput", Model)
		</div>
		<div class="minification-settings">
			<div class="minification-settings-inner">
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_SpacesCommentsAndCdataSections</legend>
					<div class="form-group">
						@(Html.DropDownListFor(m => m.Settings.WhitespaceMinificationMode,
							Model.Settings.WhitespaceMinificationModeList, new { @class="form-control" }))
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.RemoveHtmlComments)
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.RemoveHtmlCommentsFromScriptsAndStyles)
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_DoctypeTagsAndAttributes</legend>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.UseShortDoctype)
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.UseMetaCharsetTag)
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.RenderEmptyTagsWithSpace)
					</div>
					<div class="checkbox checkbox-unsafe">
						@(Html.CheckBoxWithLabelFor(m => m.Settings.RemoveTagsWithoutContent))
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.RemoveEmptyAttributes)
					</div>
					<div class="checkbox-unsafe">
						@Html.CheckBoxWithLabelFor(m => m.Settings.RemoveRedundantAttributes)
					</div>

					<div class="checkbox checkbox-unsafe">
						@(Html.CheckBoxWithLabelFor(m => m.Settings.RemoveHttpProtocolFromAttributes))
					</div>
					<div class="checkbox checkbox-unsafe">
						@(Html.CheckBoxWithLabelFor(m => m.Settings.RemoveHttpsProtocolFromAttributes))
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.RemoveJsProtocolFromAttributes)
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_EmbeddedAndInlineCss</legend>
					<div class="form-group">
						@(Html.DropDownListFor(m => m.Settings.CssMinifierName, Model.Settings.AvailableCssMinifierList,
							new { @class="form-control" }))
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.MinifyEmbeddedCssCode)
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.MinifyInlineCssCode)
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_EmbeddedAndInlineJavaScript</legend>
					<div class="form-group">
						@(Html.DropDownListFor(m => m.Settings.JsMinifierName, Model.Settings.AvailableJsMinifierList,
							new { @class="form-control" }))
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.MinifyEmbeddedJsCode)
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.MinifyInlineJsCode)
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_JavaScriptTemplating</legend>
					<div class="form-group">
						@(Html.TextBoxFor(m => m.Settings.ProcessableScriptTypeList,
							new { @class = "form-control", placeholder = CommonHtmlMinificationStrings.DisplayName_ProcessableScriptTypeList }))
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.MinifyKnockoutBindingExpressions)
					</div>
					<div class="checkbox">
						@Html.CheckBoxWithLabelFor(m => m.Settings.MinifyAngularBindingExpressions)
					</div>
					<div class="form-group">
						@(Html.TextBoxFor(m => m.Settings.CustomAngularDirectiveList,
							new { @class = "form-control", placeholder = CommonHtmlMinificationStrings.DisplayName_CustomAngularDirectiveList }))
					</div>
				</fieldset>
			</div>
		</div>
	</div>
}

@section Scripts {
	@Scripts.Render("~/Bundles/MinificationFormScripts")
}